home *** CD-ROM | disk | FTP | other *** search
- /*
- NSPopUpButton.h
- Application Kit, Release 2.0
- Copyright (c) 1994, NeXT, Inc. All rights reserved.
- */
-
- #import <Foundation/Foundation.h>
- #import "NSButton.h"
-
- @class NSString;
- @class NSFont;
- @class NSMatrix;
- @class NSMenuCell;
-
- @interface NSPopUpButton : NSButton
- {
- BOOL pullsDown;
- id target;
- SEL action;
- }
-
- - (id)initWithFrame:(NSRect)buttonFrame pullsDown:(BOOL)flag;
-
- - setPullsDown:(BOOL)flag;
- - (BOOL)pullsDown;
-
- /* Backdoor access for experts, allows "sizeToFit", etc. */
- - (NSMatrix *)itemMatrix; // NSMatrix of NSButtonCells
-
- - (int)numberOfItems;
- - addItemWithTitle:(NSString *)title;
- - (void)addItemsWithTitles:(NSArray *)itemTitles;
- - insertItemWithTitle:(NSString *)title atIndex:(int)index;
- - removeItemWithTitle:(NSString *)title;
- - removeItemAtIndex:(int)index;
- - (void)removeAllItems;
- /* This is iffy (good for subclassers). */
- - (void)synchronizeTitleAndSelectedItem;
- - (void)selectItemWithTitle:(NSString *)title;
- - (void)selectItemAtIndex:(int)index;
- - (NSButtonCell *)itemAtIndex:(int)index;
- - (NSButtonCell *)itemWithTitle:(NSString *)title;
- - (NSButtonCell *)selectedItem;
- - (NSButtonCell *)lastItem;
- - (NSString *)itemTitleAtIndex:(int)index;
- - (NSString *)titleOfSelectedItem;
- - (int)indexOfSelectedItem;
- - (int)indexOfItemWithTitle:(NSString *)title;
- - (NSArray *)itemTitles;
- - (NSFont *)font;
- - setFont:(NSFont *)fontObject;
-
- /* This is a no-op in NSControl, but it is here because we override */
- /* it to return the titleOfSelectedItem. This is useful if there is */
- /* a TextField or something that is supposed to reflect the most */
- /* recent PopUp selection. */
- - (NSString *)stringValue;
- /* Adds semantic to NSButton's method that if there is no item in */
- /* popup matching title, then an item of that name is added. */
- - setTitle:(NSString *)aString;
- - (void)setAutoenablesItems:(BOOL)flag;
- - (BOOL)autoenablesItems;
-
-
- @end
-